package net.yihang.demo.demo_quartz.jobs;

import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.LocalTime;

@Component
@Scope("prototype")
@DisallowConcurrentExecution
public class Job2 implements Job {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {

        System.out.println("job2 trigger by:" + context.getTrigger().getKey() + " " + LocalTime.now());
    }
}
